<html>

<head>
<title>Globals: Host Display Info</title>
<style type="text/css"><!--tt { font-size: 10pt } pre { font-size: 10pt }--></style>
</head>

<body bgcolor="#ffffff" text="#000000" link="#000080" vlink="#800000" alink="#0000ff">

<table border="0" cellpadding="0" cellspacing="0" bgcolor="#d0d0d0">
  <tr>
    <td width="120" align="left"><a href="gmempool.html"><img width="96" height="20"
    border="0" src="../images/navlt.gif" alt="Global Memory"></a></td>
    <td width="96" align="left"><a href="imglist.html"><img width="64" height="20" border="0"
    src="../images/navrt.gif" alt="Image List"></a></td>
    <td width="96" align="left"><a href="../globals.html"><img width="56" height="20"
    border="0" src="../images/navup.gif" alt="Globals"></a></td>
    <td width="288" align="right"><a href="../index.html"><img width="230" height="20"
    border="0" src="../images/proglw.gif" alt="Table of Contents"></a></td>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="600"><br>
    <h3>Host Display Info</h3>
    <p><small><strong>Availability</strong>&nbsp; LightWave&reg; 6.0</small><br>
    <small><strong>Component</strong>&nbsp; Layout, Modeler</small><br>
    <small><strong>Header</strong>&nbsp; <a href="../../include/lwdisplay.h">lwdisplay.h</a></small></p>
    <p>The host display global returns platform-specific information about LightWave&reg;'s
    interface. This is primarily useful when you want to create a platform-dependent interface
    for your plug-in.</p>
    <p><strong>Global Call</strong></p>
    <pre>   HostDisplayInfo *hdi;
   hdi = global( LWHOSTDISPLAYINFO_GLOBAL, GFUSE_TRANSIENT );</pre>
    <p>The global function returns a pointer to a HostDisplayInfo, or NULL if called in a
    non-interactive (e.g. Screamernet) context.</p>
    <pre>   typedef struct st_HostDisplayInfo {
    #ifdef _WIN32
      HANDLE    <strong>instance</strong>;
      HWND      <strong>window</strong>;
    #endif
    #ifdef _XGL
      Display  *<strong>xsys</strong>;
      Window    <strong>window</strong>;
    #endif
    #ifdef _MACOS
      WindowPtr <strong>window</strong>;
    #endif
   } HostDisplayInfo;</pre>
    <p>The operating system #defines (<tt>_WIN32</tt>, <tt>_XGL</tt>, <tt>_MACOS</tt>) are
    discussed in the section on <a href="../compile.html">plug-in compiling</a>.<dl>
      <dt><strong><tt>window</tt></strong></dt>
      <dd>LightWave&reg;'s main window. This is often used as the parent window of the plug-in's main
        window. </dd>
      <dt><tt><br>
        _WIN32 <strong>instance</strong></tt></dt>
      <dd>Under Microsoft Windows, this is the instance handle for the LightWave&reg; process. You
        won't need this very often. If you want a handle to a resource (dialog templates, icons,
        bitmaps) that's stored in your plug-in's .p file, you need to use <em>your plug-in's</em>
        instance handle, not LightWave&reg;'s. See your Win32 documentation to find out how to get your
        instance handle using the <tt>DllMain</tt> function.</dd>
      <dt><tt><br>
        _XGL <strong>xsys</strong></tt></dt>
      <dd>Under Unix, this is LightWave&reg;'s window session handle.</dd>
    </dl>
    <p><strong>Example</strong></p>
    <p>This code fragment displays everyone's favorite first message, but using the Win32 <tt>MessageBox</tt>
    function with LightWave&reg;'s main window handle as the parent window.</p>
    <pre>   #include &lt;lwserver.h&gt;
   #include &lt;lwdisplay.h&gt;   /* includes windows.h under Windows */

   HostDisplayInfo *hdi;

   hdi = global( LWHOSTDISPLAYINFO_GLOBAL, GFUSE_TRANSIENT );

   if ( hdi ) {
      MessageBox( hdi-&gt;window, &quot;Hello, world!&quot;, &quot;My Message&quot;, MB_OK );
   }
</pre>
    </td>
  </tr>
</table>
</body>
</html>
